<template>
  <div class="box7">
    <div class="title">
      <p>年度游客量对比</p>
      <img src="../../images/dataScreen-title.png" alt="" />
    </div>
    <div class="charts" ref="charts"></div>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'
import * as echarts from 'echarts'
//获取DOM节点
let charts = ref()
onMounted(() => {
  let mycharts = echarts.init(charts.value)
  mycharts.setOption({
    title: {
      text: '散点图',
      textStyle: {
        color: 'white',
      },
    },
    xAxis: {
      //坐标轴类型,'category' 类目轴
      type: 'category',
      show: true,
    },
    yAxis: {
      show: false,
    },
    grid: {
      left: 20,
      top: 0,
      right: 10,
      bottom: 20,
    },
    series: {
      type: 'scatter',
      data: [33, 88, 66, 50, 99, 234, 1014, 265, 550, 520, 1100, 1080, 88],
      symbol: 'diamond',
      symbolSize: 16,
      label: {
        show: true,
        position: 'top',
      },
    },
  })
})
</script>

<style scoped lang="scss">
.box7 {
  background: url(../../images/dataScreen-main-cb.png) no-repeat;
  background-size: 100% 100%;
  margin-bottom: 10px;

  .title {
    color: white;
    padding-left: 20px;
  }

  .charts {
    width: 100%;
    height: calc(100% - 30px);
  }
}
</style>
